<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>p4vasp.setutils</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="p4vasp-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="../index.html">p4vasp</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="p4vasp-module.html">Package&nbsp;p4vasp</a> ::
        Module&nbsp;setutils
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="p4vasp.setutils-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="p4vasp.setutils-module.html">Module p4vasp.setutils</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt>  <tt class="py-line"><tt class="py-comment"># HappyDoc:docStringFormat='ClassicStructuredText'</tt> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt>  <tt class="py-line"><tt class="py-comment">#  p4vasp is a GUI-program and a library for processing outputs of the</tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt>  <tt class="py-line"><tt class="py-comment">#  Vienna Ab-inition Simulation Package (VASP)</tt> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt>  <tt class="py-line"><tt class="py-comment">#  (see http://cms.mpi.univie.ac.at/vasp/Welcome.html)</tt> </tt>
<a name="L7"></a><tt class="py-lineno"> 7</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L8"></a><tt class="py-lineno"> 8</tt>  <tt class="py-line"><tt class="py-comment">#  Copyright (C) 2003  Orest Dubay &lt;odubay@users.sourceforge.net&gt;</tt> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L10"></a><tt class="py-lineno">10</tt>  <tt class="py-line"><tt class="py-comment">#  This program is free software; you can redistribute it and/or modify</tt> </tt>
<a name="L11"></a><tt class="py-lineno">11</tt>  <tt class="py-line"><tt class="py-comment">#  it under the terms of the GNU General Public License as published by</tt> </tt>
<a name="L12"></a><tt class="py-lineno">12</tt>  <tt class="py-line"><tt class="py-comment">#  the Free Software Foundation; either version 2 of the License, or</tt> </tt>
<a name="L13"></a><tt class="py-lineno">13</tt>  <tt class="py-line"><tt class="py-comment">#  (at your option) any later version.</tt> </tt>
<a name="L14"></a><tt class="py-lineno">14</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L15"></a><tt class="py-lineno">15</tt>  <tt class="py-line"><tt class="py-comment">#  This program is distributed in the hope that it will be useful,</tt> </tt>
<a name="L16"></a><tt class="py-lineno">16</tt>  <tt class="py-line"><tt class="py-comment">#  but WITHOUT ANY WARRANTY; without even the implied warranty of</tt> </tt>
<a name="L17"></a><tt class="py-lineno">17</tt>  <tt class="py-line"><tt class="py-comment">#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</tt> </tt>
<a name="L18"></a><tt class="py-lineno">18</tt>  <tt class="py-line"><tt class="py-comment">#  GNU General Public License for more details.</tt> </tt>
<a name="L19"></a><tt class="py-lineno">19</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L20"></a><tt class="py-lineno">20</tt>  <tt class="py-line"><tt class="py-comment">#   You should have received a copy of the GNU General Public License</tt> </tt>
<a name="L21"></a><tt class="py-lineno">21</tt>  <tt class="py-line"><tt class="py-comment">#  along with this program; if not, write to the Free Software</tt> </tt>
<a name="L22"></a><tt class="py-lineno">22</tt>  <tt class="py-line"><tt class="py-comment">#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</tt> </tt>
<a name="L23"></a><tt class="py-lineno">23</tt>  <tt class="py-line"> </tt>
<a name="L24"></a><tt class="py-lineno">24</tt>  <tt class="py-line"> </tt>
<a name="L25"></a><tt class="py-lineno">25</tt>  <tt class="py-line"> </tt>
<a name="L26"></a><tt class="py-lineno">26</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L27"></a><tt class="py-lineno">27</tt>  <tt class="py-line"><tt class="py-docstring">Set utilities.</tt> </tt>
<a name="L28"></a><tt class="py-lineno">28</tt>  <tt class="py-line"><tt class="py-docstring">This module contains functions that allow handling lists as sets.</tt> </tt>
<a name="L29"></a><tt class="py-lineno">29</tt>  <tt class="py-line"><tt class="py-docstring">(Set is a list, which does not contain duplicate elements.)</tt> </tt>
<a name="L30"></a><tt class="py-lineno">30</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="to_set"></a><div id="to_set-def"><a name="L31"></a><tt class="py-lineno">31</tt> <a class="py-toggle" href="#" id="to_set-toggle" onclick="return toggle('to_set');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="p4vasp.setutils-module.html#to_set">to_set</a><tt class="py-op">(</tt><tt class="py-param">l</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="to_set-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="to_set-expanded"><a name="L32"></a><tt class="py-lineno">32</tt>  <tt class="py-line">    <tt class="py-docstring">"Removes duplicite elements from  *l*. Equivalent to append_set([],l)"</tt> </tt>
<a name="L33"></a><tt class="py-lineno">33</tt>  <tt class="py-line">    <tt id="link-0" class="py-name" targets="Method p4vasp.cStructure.Structure.set()=p4vasp.cStructure.Structure-class.html#set,Method p4vasp.cmatrix.Matrix.set()=p4vasp.cmatrix.Matrix-class.html#set,Method p4vasp.cmatrix.Vector.set()=p4vasp.cmatrix.Vector-class.html#set,Method p4vasp.matrix.Matrix.set()=p4vasp.matrix.Matrix-class.html#set,Method p4vasp.matrix.Vector.set()=p4vasp.matrix.Vector-class.html#set"><a title="p4vasp.cStructure.Structure.set
p4vasp.cmatrix.Matrix.set
p4vasp.cmatrix.Vector.set
p4vasp.matrix.Matrix.set
p4vasp.matrix.Vector.set" class="py-name" href="#" onclick="return doclink('link-0', 'set', 'link-0');">set</a></tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L34"></a><tt class="py-lineno">34</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">x</tt> <tt class="py-keyword">in</tt> <tt class="py-name">l</tt><tt class="py-op">:</tt> </tt>
<a name="L35"></a><tt class="py-lineno">35</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">x</tt> <tt class="py-keyword">not</tt> <tt class="py-keyword">in</tt> <tt id="link-1" class="py-name"><a title="p4vasp.cStructure.Structure.set
p4vasp.cmatrix.Matrix.set
p4vasp.cmatrix.Vector.set
p4vasp.matrix.Matrix.set
p4vasp.matrix.Vector.set" class="py-name" href="#" onclick="return doclink('link-1', 'set', 'link-0');">set</a></tt><tt class="py-op">:</tt> </tt>
<a name="L36"></a><tt class="py-lineno">36</tt>  <tt class="py-line">            <tt id="link-2" class="py-name"><a title="p4vasp.cStructure.Structure.set
p4vasp.cmatrix.Matrix.set
p4vasp.cmatrix.Vector.set
p4vasp.matrix.Matrix.set
p4vasp.matrix.Vector.set" class="py-name" href="#" onclick="return doclink('link-2', 'set', 'link-0');">set</a></tt><tt class="py-op">.</tt><tt id="link-3" class="py-name" targets="Method p4vasp.Structure.AtomInfo.append()=p4vasp.Structure.AtomInfo-class.html#append,Method p4vasp.Structure.Structure.append()=p4vasp.Structure.Structure-class.html#append,Method p4vasp.cStructure.AtomInfo.append()=p4vasp.cStructure.AtomInfo-class.html#append,Method p4vasp.cStructure.Structure.append()=p4vasp.cStructure.Structure-class.html#append,Method p4vasp.graph.Graph.append()=p4vasp.graph.Graph-class.html#append,Method p4vasp.graph.World.append()=p4vasp.graph.World-class.html#append,Method p4vasp.repository.Repository.append()=p4vasp.repository.Repository-class.html#append"><a title="p4vasp.Structure.AtomInfo.append
p4vasp.Structure.Structure.append
p4vasp.cStructure.AtomInfo.append
p4vasp.cStructure.Structure.append
p4vasp.graph.Graph.append
p4vasp.graph.World.append
p4vasp.repository.Repository.append" class="py-name" href="#" onclick="return doclink('link-3', 'append', 'link-3');">append</a></tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
<a name="L37"></a><tt class="py-lineno">37</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-4" class="py-name"><a title="p4vasp.cStructure.Structure.set
p4vasp.cmatrix.Matrix.set
p4vasp.cmatrix.Vector.set
p4vasp.matrix.Matrix.set
p4vasp.matrix.Vector.set" class="py-name" href="#" onclick="return doclink('link-4', 'set', 'link-0');">set</a></tt> </tt>
</div><a name="L38"></a><tt class="py-lineno">38</tt>  <tt class="py-line"> </tt>
<a name="append_set"></a><div id="append_set-def"><a name="L39"></a><tt class="py-lineno">39</tt> <a class="py-toggle" href="#" id="append_set-toggle" onclick="return toggle('append_set');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="p4vasp.setutils-module.html#append_set">append_set</a><tt class="py-op">(</tt><tt class="py-param">l</tt><tt class="py-op">,</tt><tt class="py-param">set</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="append_set-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="append_set-expanded"><a name="L40"></a><tt class="py-lineno">40</tt>  <tt class="py-line">    <tt class="py-docstring">"Set addition - *set* is appended to set *l* ."</tt> </tt>
<a name="L41"></a><tt class="py-lineno">41</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">x</tt> <tt class="py-keyword">in</tt> <tt id="link-5" class="py-name"><a title="p4vasp.cStructure.Structure.set
p4vasp.cmatrix.Matrix.set
p4vasp.cmatrix.Vector.set
p4vasp.matrix.Matrix.set
p4vasp.matrix.Vector.set" class="py-name" href="#" onclick="return doclink('link-5', 'set', 'link-0');">set</a></tt><tt class="py-op">:</tt> </tt>
<a name="L42"></a><tt class="py-lineno">42</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">x</tt> <tt class="py-keyword">not</tt> <tt class="py-keyword">in</tt> <tt class="py-name">l</tt><tt class="py-op">:</tt> </tt>
<a name="L43"></a><tt class="py-lineno">43</tt>  <tt class="py-line">            <tt class="py-name">l</tt><tt class="py-op">.</tt><tt id="link-6" class="py-name"><a title="p4vasp.Structure.AtomInfo.append
p4vasp.Structure.Structure.append
p4vasp.cStructure.AtomInfo.append
p4vasp.cStructure.Structure.append
p4vasp.graph.Graph.append
p4vasp.graph.World.append
p4vasp.repository.Repository.append" class="py-name" href="#" onclick="return doclink('link-6', 'append', 'link-3');">append</a></tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
<a name="L44"></a><tt class="py-lineno">44</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">l</tt> </tt>
</div><a name="L45"></a><tt class="py-lineno">45</tt>  <tt class="py-line"> </tt>
<a name="join_sets"></a><div id="join_sets-def"><a name="L46"></a><tt class="py-lineno">46</tt> <a class="py-toggle" href="#" id="join_sets-toggle" onclick="return toggle('join_sets');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="p4vasp.setutils-module.html#join_sets">join_sets</a><tt class="py-op">(</tt><tt class="py-param">sets</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="join_sets-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="join_sets-expanded"><a name="L47"></a><tt class="py-lineno">47</tt>  <tt class="py-line">    <tt class="py-docstring">"Join all sets in the list *sets* into one set."</tt> </tt>
<a name="L48"></a><tt class="py-lineno">48</tt>  <tt class="py-line">    <tt class="py-name">l</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L49"></a><tt class="py-lineno">49</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">s</tt> <tt class="py-keyword">in</tt> <tt class="py-name">sets</tt><tt class="py-op">:</tt> </tt>
<a name="L50"></a><tt class="py-lineno">50</tt>  <tt class="py-line">        <tt id="link-7" class="py-name" targets="Function p4vasp.setutils.append_set()=p4vasp.setutils-module.html#append_set"><a title="p4vasp.setutils.append_set" class="py-name" href="#" onclick="return doclink('link-7', 'append_set', 'link-7');">append_set</a></tt><tt class="py-op">(</tt><tt class="py-name">l</tt><tt class="py-op">,</tt><tt class="py-name">s</tt><tt class="py-op">)</tt> </tt>
<a name="L51"></a><tt class="py-lineno">51</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">l</tt> </tt>
</div><a name="L52"></a><tt class="py-lineno">52</tt>  <tt class="py-line"> </tt>
<a name="contains_set"></a><div id="contains_set-def"><a name="L53"></a><tt class="py-lineno">53</tt> <a class="py-toggle" href="#" id="contains_set-toggle" onclick="return toggle('contains_set');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="p4vasp.setutils-module.html#contains_set">contains_set</a><tt class="py-op">(</tt><tt class="py-param">l</tt><tt class="py-op">,</tt><tt class="py-param">set</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="contains_set-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="contains_set-expanded"><a name="L54"></a><tt class="py-lineno">54</tt>  <tt class="py-line">    <tt class="py-docstring">"Check if all elements of *set* are present in *l* ."</tt> </tt>
<a name="L55"></a><tt class="py-lineno">55</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">x</tt> <tt class="py-keyword">in</tt> <tt id="link-8" class="py-name"><a title="p4vasp.cStructure.Structure.set
p4vasp.cmatrix.Matrix.set
p4vasp.cmatrix.Vector.set
p4vasp.matrix.Matrix.set
p4vasp.matrix.Vector.set" class="py-name" href="#" onclick="return doclink('link-8', 'set', 'link-0');">set</a></tt><tt class="py-op">:</tt> </tt>
<a name="L56"></a><tt class="py-lineno">56</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">x</tt> <tt class="py-keyword">not</tt> <tt class="py-keyword">in</tt> <tt class="py-name">l</tt><tt class="py-op">:</tt> </tt>
<a name="L57"></a><tt class="py-lineno">57</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-number">0</tt> </tt>
<a name="L58"></a><tt class="py-lineno">58</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-number">1</tt> </tt>
</div><a name="L59"></a><tt class="py-lineno">59</tt>  <tt class="py-line"> </tt>
<a name="contains_some_elements_from_set"></a><div id="contains_some_elements_from_set-def"><a name="L60"></a><tt class="py-lineno">60</tt> <a class="py-toggle" href="#" id="contains_some_elements_from_set-toggle" onclick="return toggle('contains_some_elements_from_set');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="p4vasp.setutils-module.html#contains_some_elements_from_set">contains_some_elements_from_set</a><tt class="py-op">(</tt><tt class="py-param">l</tt><tt class="py-op">,</tt><tt class="py-param">set</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="contains_some_elements_from_set-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="contains_some_elements_from_set-expanded"><a name="L61"></a><tt class="py-lineno">61</tt>  <tt class="py-line">    <tt class="py-docstring">"Check if all elements of *set* are present in *l* ."</tt> </tt>
<a name="L62"></a><tt class="py-lineno">62</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">x</tt> <tt class="py-keyword">in</tt> <tt id="link-9" class="py-name"><a title="p4vasp.cStructure.Structure.set
p4vasp.cmatrix.Matrix.set
p4vasp.cmatrix.Vector.set
p4vasp.matrix.Matrix.set
p4vasp.matrix.Vector.set" class="py-name" href="#" onclick="return doclink('link-9', 'set', 'link-0');">set</a></tt><tt class="py-op">:</tt> </tt>
<a name="L63"></a><tt class="py-lineno">63</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">x</tt> <tt class="py-keyword">in</tt> <tt class="py-name">l</tt><tt class="py-op">:</tt> </tt>
<a name="L64"></a><tt class="py-lineno">64</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-number">1</tt> </tt>
<a name="L65"></a><tt class="py-lineno">65</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-number">0</tt> </tt>
</div><a name="L66"></a><tt class="py-lineno">66</tt>  <tt class="py-line"> </tt>
<a name="remove_set"></a><div id="remove_set-def"><a name="L67"></a><tt class="py-lineno">67</tt> <a class="py-toggle" href="#" id="remove_set-toggle" onclick="return toggle('remove_set');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="p4vasp.setutils-module.html#remove_set">remove_set</a><tt class="py-op">(</tt><tt class="py-param">l</tt><tt class="py-op">,</tt><tt class="py-param">set</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="remove_set-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="remove_set-expanded"><a name="L68"></a><tt class="py-lineno">68</tt>  <tt class="py-line">    <tt class="py-docstring">"Remove all elements of *set* from *l* ."</tt> </tt>
<a name="L69"></a><tt class="py-lineno">69</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">x</tt> <tt class="py-keyword">in</tt> <tt id="link-10" class="py-name"><a title="p4vasp.cStructure.Structure.set
p4vasp.cmatrix.Matrix.set
p4vasp.cmatrix.Vector.set
p4vasp.matrix.Matrix.set
p4vasp.matrix.Vector.set" class="py-name" href="#" onclick="return doclink('link-10', 'set', 'link-0');">set</a></tt><tt class="py-op">:</tt> </tt>
<a name="L70"></a><tt class="py-lineno">70</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">x</tt> <tt class="py-keyword">in</tt> <tt class="py-name">l</tt><tt class="py-op">:</tt> </tt>
<a name="L71"></a><tt class="py-lineno">71</tt>  <tt class="py-line">            <tt class="py-name">l</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name" targets="Method p4vasp.Structure.Structure.remove()=p4vasp.Structure.Structure-class.html#remove,Method p4vasp.repository.Repository.remove()=p4vasp.repository.Repository-class.html#remove"><a title="p4vasp.Structure.Structure.remove
p4vasp.repository.Repository.remove" class="py-name" href="#" onclick="return doclink('link-11', 'remove', 'link-11');">remove</a></tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
<a name="L72"></a><tt class="py-lineno">72</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">l</tt> </tt>
</div><a name="L73"></a><tt class="py-lineno">73</tt>  <tt class="py-line"> </tt>
<a name="find_sequence"></a><div id="find_sequence-def"><a name="L74"></a><tt class="py-lineno">74</tt> <a class="py-toggle" href="#" id="find_sequence-toggle" onclick="return toggle('find_sequence');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="p4vasp.setutils-module.html#find_sequence">find_sequence</a><tt class="py-op">(</tt><tt class="py-param">l</tt><tt class="py-op">,</tt><tt class="py-param">s</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="find_sequence-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="find_sequence-expanded"><a name="L75"></a><tt class="py-lineno">75</tt>  <tt class="py-line">    <tt class="py-docstring">"""Searches the subsequence s in the sequence l (len(l)&gt;=len(s)).</tt> </tt>
<a name="L76"></a><tt class="py-lineno">76</tt>  <tt class="py-line"><tt class="py-docstring">  Index of the first occurence is returned, otherwise *None* is returned.</tt> </tt>
<a name="L77"></a><tt class="py-lineno">77</tt>  <tt class="py-line"><tt class="py-docstring">  """</tt> </tt>
<a name="L78"></a><tt class="py-lineno">78</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-12" class="py-name" targets="Method p4vasp.cStructure.Structure.len()=p4vasp.cStructure.Structure-class.html#len"><a title="p4vasp.cStructure.Structure.len" class="py-name" href="#" onclick="return doclink('link-12', 'len', 'link-12');">len</a></tt><tt class="py-op">(</tt><tt class="py-name">s</tt><tt class="py-op">)</tt><tt class="py-op">&lt;=</tt><tt id="link-13" class="py-name"><a title="p4vasp.cStructure.Structure.len" class="py-name" href="#" onclick="return doclink('link-13', 'len', 'link-12');">len</a></tt><tt class="py-op">(</tt><tt class="py-name">l</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L79"></a><tt class="py-lineno">79</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt id="link-14" class="py-name" targets="Variable p4vasp.paint3d.OpenGLPaint3D.i=p4vasp.paint3d.OpenGLPaint3D-module.html#i"><a title="p4vasp.paint3d.OpenGLPaint3D.i" class="py-name" href="#" onclick="return doclink('link-14', 'i', 'link-14');">i</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt id="link-15" class="py-name"><a title="p4vasp.cStructure.Structure.len" class="py-name" href="#" onclick="return doclink('link-15', 'len', 'link-12');">len</a></tt><tt class="py-op">(</tt><tt class="py-name">l</tt><tt class="py-op">)</tt><tt class="py-op">-</tt><tt id="link-16" class="py-name"><a title="p4vasp.cStructure.Structure.len" class="py-name" href="#" onclick="return doclink('link-16', 'len', 'link-12');">len</a></tt><tt class="py-op">(</tt><tt class="py-name">s</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L80"></a><tt class="py-lineno">80</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">l</tt><tt class="py-op">[</tt><tt id="link-17" class="py-name"><a title="p4vasp.paint3d.OpenGLPaint3D.i" class="py-name" href="#" onclick="return doclink('link-17', 'i', 'link-14');">i</a></tt><tt class="py-op">:</tt><tt id="link-18" class="py-name"><a title="p4vasp.paint3d.OpenGLPaint3D.i" class="py-name" href="#" onclick="return doclink('link-18', 'i', 'link-14');">i</a></tt><tt class="py-op">+</tt><tt id="link-19" class="py-name"><a title="p4vasp.cStructure.Structure.len" class="py-name" href="#" onclick="return doclink('link-19', 'len', 'link-12');">len</a></tt><tt class="py-op">(</tt><tt class="py-name">s</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">==</tt><tt class="py-name">s</tt><tt class="py-op">:</tt> </tt>
<a name="L81"></a><tt class="py-lineno">81</tt>  <tt class="py-line">                <tt class="py-keyword">return</tt> <tt id="link-20" class="py-name"><a title="p4vasp.paint3d.OpenGLPaint3D.i" class="py-name" href="#" onclick="return doclink('link-20', 'i', 'link-14');">i</a></tt> </tt>
<a name="L82"></a><tt class="py-lineno">82</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">None</tt> </tt>
</div><a name="L83"></a><tt class="py-lineno">83</tt>  <tt class="py-line"> </tt>
<a name="remove_sequence"></a><div id="remove_sequence-def"><a name="L84"></a><tt class="py-lineno">84</tt> <a class="py-toggle" href="#" id="remove_sequence-toggle" onclick="return toggle('remove_sequence');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="p4vasp.setutils-module.html#remove_sequence">remove_sequence</a><tt class="py-op">(</tt><tt class="py-param">l</tt><tt class="py-op">,</tt><tt class="py-param">s</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="remove_sequence-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="remove_sequence-expanded"><a name="L85"></a><tt class="py-lineno">85</tt>  <tt class="py-line">    <tt class="py-docstring">"""Removes the subsequence s from the sequence l (if the subsequence is present).</tt> </tt>
<a name="L86"></a><tt class="py-lineno">86</tt>  <tt class="py-line"><tt class="py-docstring">  The result is returned.</tt> </tt>
<a name="L87"></a><tt class="py-lineno">87</tt>  <tt class="py-line"><tt class="py-docstring">  """</tt> </tt>
<a name="L88"></a><tt class="py-lineno">88</tt>  <tt class="py-line">    <tt id="link-21" class="py-name"><a title="p4vasp.paint3d.OpenGLPaint3D.i" class="py-name" href="#" onclick="return doclink('link-21', 'i', 'link-14');">i</a></tt><tt class="py-op">=</tt><tt id="link-22" class="py-name" targets="Function p4vasp.setutils.find_sequence()=p4vasp.setutils-module.html#find_sequence"><a title="p4vasp.setutils.find_sequence" class="py-name" href="#" onclick="return doclink('link-22', 'find_sequence', 'link-22');">find_sequence</a></tt><tt class="py-op">(</tt><tt class="py-name">l</tt><tt class="py-op">,</tt><tt class="py-name">s</tt><tt class="py-op">)</tt> </tt>
<a name="L89"></a><tt class="py-lineno">89</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-23" class="py-name"><a title="p4vasp.paint3d.OpenGLPaint3D.i" class="py-name" href="#" onclick="return doclink('link-23', 'i', 'link-14');">i</a></tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L90"></a><tt class="py-lineno">90</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">l</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt id="link-24" class="py-name"><a title="p4vasp.paint3d.OpenGLPaint3D.i" class="py-name" href="#" onclick="return doclink('link-24', 'i', 'link-14');">i</a></tt><tt class="py-op">]</tt> <tt class="py-op">+</tt> <tt class="py-name">l</tt><tt class="py-op">[</tt><tt id="link-25" class="py-name"><a title="p4vasp.paint3d.OpenGLPaint3D.i" class="py-name" href="#" onclick="return doclink('link-25', 'i', 'link-14');">i</a></tt><tt class="py-op">+</tt><tt id="link-26" class="py-name"><a title="p4vasp.cStructure.Structure.len" class="py-name" href="#" onclick="return doclink('link-26', 'len', 'link-12');">len</a></tt><tt class="py-op">(</tt><tt class="py-name">s</tt><tt class="py-op">)</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> </tt>
<a name="L91"></a><tt class="py-lineno">91</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">l</tt> </tt>
</div><a name="L92"></a><tt class="py-lineno">92</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="p4vasp-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="../index.html">p4vasp</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Sun Aug 16 22:08:14 2015
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
